import request from '@/utils/request'
/* 连接列表 */
export function redisAll(param) {
    return request({
        url: '/sjcc/redis/all',
        method: 'get',
        params: param,
        Bearer: 'hidden',
    })
}

/* 连接 */
export function redisConnect(param) {
    return request({
        url: '/sjcc/redis/connect',
        method: 'get',
        params: param,
        Bearer: 'hidden',
    })
}

/* key详情 */
export function queryDetailByKey(param) {
    return request({
        url: '/sjcc/redis/queryDetailByKey',
        method: 'get',
        params: param,
        Bearer: 'hidden',
    })
}

/* 连接 */
export function page(param) {
    return request({
        url: '/sjcc/redis/page',
        method: 'get',
        params: param,
        Bearer: 'hidden',
    })
}

/* 删除 */
export function deleteKey(data) {
    return request({
        url: '/sjcc/redis/deleteKey',
        method: 'delete',
        data,
        Bearer: 'hidden',
    })
}

/* 测试连接 */
export function testConnection(data) {
    return request({
        url: '/sjcc/redis/testConnection',
        method: 'post',
        data,
        Bearer: 'hidden',
    })
}

/* 新增key */
export function add(data) {
    return request({
        url: '/sjcc/redis/add',
        method: 'post',
        data,
        Bearer: 'hidden',
    })
}

/* 新增连接 */
export function addConnect(data) {
    return request({
        url: '/sjcc/redis/addConnect',
        method: 'post',
        data,
        Bearer: 'hidden',
    })
}

/* 设置key的TTL */
export function setKeyTTL(data) {
    return request({
        url: '/sjcc/redis/setKeyTTL',
        method: 'put',
        data,
        Bearer: 'hidden',
    })
}

/* 新增连接 */
export function renameKey(data) {
    return request({
        url: '/sjcc/redis/renameKey',
        method: 'put',
        data,
        Bearer: 'hidden',
    })
}